﻿using System;

namespace Picnic
{
    /// <summary>
    /// Represents an Int32 extension.
    /// </summary>
    public static class Int32Extension
    {
        /// <summary>
        /// N-times repeat specified action.
        /// </summary>
        /// <param name="n">A count of repitation.</param>
        /// <param name="action">A repitable action.</param>
        public static void Times(this int n, Action action)
        {
            for (var i = 0; i < n; i++)
            {
                action();
            }
        }
    }
}
